package JZOffer;

public class _10 {
    class Solution{
        public int Numberof1(int n) {
            int count = 0;
            while (n != 0) {
                n &= (n-1);
                count++;
            }
            return count;
        }
    }

    Solution getSolution() {
        return new Solution();
    }

    public static void main(String args[]) {
        _10 c = new _10();
        _10.Solution s  = c.getSolution();
        int n = 3;
        System.out.println(s.Numberof1(n));
    }
}
